home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / diff.arc / DIFF.DOC < prev    next >
Text File  |  1988-07-20  |  6KB  |  200 lines

  1.  
  2.  
  3.  
  4.      C✓C✓C✓CD✓D✓D✓DI✓I✓I✓IF✓F✓F✓FF✓F✓F✓F(✓(✓(✓(1✓1✓1✓1)✓)✓)✓)                    U✓U✓U✓UN✓N✓N✓NI✓I✓I✓IX✓X✓X✓X 5✓5✓5✓5.✓.✓.✓.0✓0✓0✓0                     C✓C✓C✓CD✓D✓D✓DI✓I✓I✓IF✓F✓F✓FF✓F✓F✓F(✓(✓(✓(1✓1✓1✓1)✓)✓)✓)
  5.  
  6.  
  7.  
  8.      N✓N✓N✓NA✓A✓A✓AM✓M✓M✓ME✓E✓E✓E
  9.           cdiff - Public Domain cdiff (context diff) program
  10.  
  11.      S✓S✓S✓SY✓Y✓Y✓YN✓N✓N✓NO✓O✓O✓OP✓P✓P✓PS✓S✓S✓SI✓I✓I✓IS✓S✓S✓S
  12.           d✓d✓d✓di✓i✓i✓if✓f✓f✓ff✓f✓f✓f [ -✓-✓-✓-b✓b✓b✓b -✓-✓-✓-c✓c✓c✓c -✓-✓-✓-i✓i✓i✓i -✓-✓-✓-e✓e✓e✓e ] file1 file2
  13.  
  14.      D✓D✓D✓DE✓E✓E✓ES✓S✓S✓SC✓C✓C✓CR✓R✓R✓RI✓I✓I✓IP✓P✓P✓PT✓T✓T✓TI✓I✓I✓IO✓O✓O✓ON✓N✓N✓N
  15.           _✓D_✓i_✓f_✓f compares two files, showing what must be changed to
  16.           make them identical. Either file1 or file2 (but not both)
  17.           may refer to directories. If that is the case, a file in the
  18.           directory whose name is the same as the other file argument
  19.           will be used. The standard input may be used for one of the
  20.           files by replacing the argument by "-". Except for the
  21.           standard input, both files must be on disk devices.
  22.  
  23.      O✓O✓O✓OP✓P✓P✓PT✓T✓T✓TI✓I✓I✓IO✓O✓O✓ON✓N✓N✓NS✓S✓S✓S
  24.           -✓-✓-✓-b✓b✓b✓b Remove trailing whitespace (blanks and tabs) and compress
  25.                all other strings of whitespace to a single blank.
  26.  
  27.           -✓-✓-✓-c✓c✓c✓c Print some context -- matching lines before and after the
  28.                non-match section.  Mark non-matched sections with "|".
  29.  
  30.           -✓-✓-✓-i✓i✓i✓i Ignore lower/upper case distinctions.
  31.  
  32.           -✓-✓-✓-e✓e✓e✓e Output is in an "editor script" format which is
  33.                compatible with the Unix 'ed' editor.
  34.  
  35.           All information needed to compare the files is maintained in
  36.           main memory. This means that very large files (or fairly
  37.           large files with many differences) will cause the program to
  38.           abort with an "out of space" message. Main memory
  39.           requirements (in words) are approximately:
  40.  
  41.                     2 * (length of file1 + length of file2)
  42.                            + 3 * (number of changes)
  43.  
  44.           (Where "length" is the number of lines of data in each
  45.           file.)
  46.  
  47.           The algorithm reads each file twice, once to build hash
  48.           tables and once to check for fortuitous matches (two lines
  49.           that are in fact different, but which have the same hash
  50.           value). CPU time requirements include sorting the hash
  51.           tables and randomly searching memory tables for equivalence
  52.           classes. For example, on a time-shared VAX-11/780, comparing
  53.           two 1000 line files required about 30 seconds (elapsed clock
  54.           time) and about 10,000 bytes of working storage. About 90
  55.           per-cent of the time was taken up by file I/O.
  56.  
  57.      D✓D✓D✓DI✓I✓I✓IA✓A✓A✓AG✓G✓G✓GN✓N✓N✓NO✓O✓O✓OS✓S✓S✓ST✓T✓T✓TI✓I✓I✓IC✓C✓C✓CS✓S✓S✓S
  58.           Warning, bad option 'x'
  59.                The option is ignored.
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 1/13/88)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      C✓C✓C✓CD✓D✓D✓DI✓I✓I✓IF✓F✓F✓FF✓F✓F✓F(✓(✓(✓(1✓1✓1✓1)✓)✓)✓)                    U✓U✓U✓UN✓N✓N✓NI✓I✓I✓IX✓X✓X✓X 5✓5✓5✓5.✓.✓.✓.0✓0✓0✓0                     C✓C✓C✓CD✓D✓D✓DI✓I✓I✓IF✓F✓F✓FF✓F✓F✓F(✓(✓(✓(1✓1✓1✓1)✓)✓)✓)
  71.  
  72.  
  73.  
  74.           Usage ...
  75.                Two input files were not specified.
  76.  
  77.           Can't open input file "filename".
  78.                Can't continue.
  79.  
  80.           Out of space
  81.                The program ran out of memory while comparing the two
  82.                files.
  83.  
  84.           Can't read line nnn at xxx in file[A/B]
  85.                This indicates an I/O error when seeking to the
  86.                specific line.  It should not happen.
  87.  
  88.           Spurious match, output is not optimal.
  89.                Two lines that were different yielded the same hash
  90.                value.  This is harmless except that the difference
  91.                output is not the minimum set of differences between
  92.                the two files.  For example, instead of the output:
  93.                           lines 1 to 5 were changed to ...
  94.                the program will print
  95.                           lines 1 to 3 were changed to ...
  96.                           lines 4 to 5 were changed to ...
  97.  
  98.           The program uses a CRC16 hash code.
  99.                The likelihood of this error is quite small.
  100.  
  101.      A✓A✓A✓AU✓U✓U✓UT✓T✓T✓TH✓H✓H✓HO✓O✓O✓OR✓R✓R✓R
  102.           The diff algorithm was developed by J. W. Hunt and M. D.
  103.           McIlroy, using a central algorithm defined by H. S. Stone.
  104.           It was published in:
  105.                Hunt, J. W., and McIlroy, M. D.,
  106.                An Algorithm for Differential File Comparison,
  107.                Computing Science Technical Report #41,
  108.                Bell Laboratories, Murray Hill, NJ  07974
  109.  
  110.      B✓B✓B✓BU✓U✓U✓UG✓G✓G✓GS✓S✓S✓S
  111.           On RSX and DECUS C on VMS systems, diff may fail if the both
  112.           files are not "variable-length, implied carriage control"
  113.           format.  The scopy program can be used to convert files to
  114.           this format if problems arise.
  115.  
  116.           When compiled under VAX C, diff handles STREAM_LF files
  117.           properly (in addition to the canonical variable-length
  118.           implied carriage control files). Other variations should
  119.           work, but have not been tested.
  120.  
  121.           When compiled under VAX C, diff is quite slow for unknown
  122.           reasons which ought to be investigated. On the other hand,
  123.           it has access to effectively unlimited memory.
  124.  
  125.           Output in a form suitable for ed - the -e option - seems
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 1/13/88)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      C✓C✓C✓CD✓D✓D✓DI✓I✓I✓IF✓F✓F✓FF✓F✓F✓F(✓(✓(✓(1✓1✓1✓1)✓)✓)✓)                    U✓U✓U✓UN✓N✓N✓NI✓I✓I✓IX✓X✓X✓X 5✓5✓5✓5.✓.✓.✓.0✓0✓0✓0                     C✓C✓C✓CD✓D✓D✓DI✓I✓I✓IF✓F✓F✓FF✓F✓F✓F(✓(✓(✓(1✓1✓1✓1)✓)✓)✓)
  137.  
  138.  
  139.  
  140.           rather pointless; the analogue on DEC systems is SLP (SUMSLP
  141.           on VMS). It would be simple to provide SLP-compatible
  142.           output. The question is, why bother - since the various DEC
  143.           file comparisonFound 424 control chars in "diff.doc"
  144. utilities already produce it.
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.      Page 3                                          (printed 1/13/88)
  197.  
  198.  
  199.  
  200.